package com.huluobo.a2207kotlindouyin.mine

import androidx.lifecycle.MutableLiveData
import com.huluobo.base.bean.VideoBean
import com.huluobo.base.db.DouYinDatabase
import com.huluobo.base.mvvm.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 *  Created by LC on 2024/11/29.
 */
@HiltViewModel
class MineViewModel @Inject constructor(
    val db: DouYinDatabase
) : BaseViewModel() {
    val queryCollectVideosSuccess by lazy { MutableLiveData<List<VideoBean>>() }
    fun queryCollectVideos() {
        executeDb(
            {
                db.getVideoDao().queryVideoInfo()
            },
            queryCollectVideosSuccess::postValue
        )
    }
}